<template>
  <div class="newlist">
    <div class="header-warpper" @click="$router.back(-1)">
      <img src="../../assets/l_jt.png" alt />
      <span>消息详情</span>
    </div>
    <ul class="mui-newslist-container">
      <li class="mui-newlist-item" v-if="title">
        <h3>{{title}}</h3>
        <span class="font-lightGray-30">{{time}}</span>
      </li>

      <div v-html="content" class="content"></div>
    </ul>
    <div style="height:1.333333rem"></div>
    <Tabbar :idx="5" />
  </div>
</template>

<script>
// @ is an alias to /src
import Tabbar from "@/views/public/Tabbar.vue";

export default {
  name: "message",
  components: {
    Tabbar
  },
  data() {
    return {
      id: "",
      title: "",
      content: "",
      time: "",
      page: 1
    };
  },
  created: function() {
    if (this.$route.query.help) {
      this.$axios
        .post("/index/apihq/articlelog1", {
          article_id: this.$route.query.id
        })
        .then(res => {
          console.log(res);
          if (res.data.code == 0) {
            this.title = res.data.info[0].title;
            this.time = res.data.info[0].create_time;
            this.content = res.data.info[0].content;
          }
        });
    } else {
      this.$axios
        .post("/index/message/getdetail", {
          logid: this.$route.query.id
        })
        .then(res => {
          console.log(res);
          if (res.data.code == 0) {
            this.title = res.data.info.title;
            this.time = res.data.info.create_time;
            this.content = res.data.info.content;
          }
        });
    }
  },
  mounted() {},
  methods: {
    tab(str) {
      this.indexs = str;
    }
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">
.f-flex {
  display: flex;
  display: -webkit-flex;
  align-items: center;
}
.newlist {
  .mui-newslist-container {
    padding: 0 0.4rem;
    .mui-newlist-item {
      text-align: left;
      padding: 0.586667rem 0;
      padding-left: 0;
      border-bottom: 1px solid #e9ebf3;
      h2 {
        text-align: left;
        font-weight: bold;
        color: #10131e;
        font-size: 0.533333rem;
        padding-bottom: 0.4rem;
        line-height: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      h3 {
        text-align: left;
        color: #10131e;
        font-size: 0.48rem;
        padding-bottom: 0.2rem;
        line-height: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .font-lightGray-30 {
        font-size: 0.4rem;
        color: #aab2ca;
        text-align: left;
      }
    }
  }
  .content {
    padding: 0.4rem 0;
    text-align: left;
    font-size: 0.36rem;
  }
}
.content img {
  width: 100%;
}
</style>

